package com.password.desktop.UI;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

import com.password.desktop.util.SysUtil;

public class ComboxRender<E> extends JLabel implements ListCellRenderer<E> {

	@Override
	public Component getListCellRendererComponent(JList<? extends E> list, E value, int index, boolean isSelected,
			boolean cellHasFocus) {
		setText(value.toString());
		setFont(SysUtil.FONT_DEFAULT);
		
		if (isSelected) {
			setBackground(new Color(51, 122, 183));
			setForeground(Color.white);
		} else {
			setBackground(Color.white);
			setForeground(Color.DARK_GRAY);
		}
		setOpaque(true);
		return this;
	}

}
